<?php
include_once($_SERVER['DOCUMENT_ROOT'] ."/include/user/inc.php");

error_reporting(E_ERROR | E_PARSE);

//error_reporting(E_ALL);
//所有的参数
$g_cgival 	= array();
//存储中间数据 非输出数据 可以不用
$g_pro	 	= array();
//要显示的数据 输出数据
$g_show 	= array();

function check_cgi_pro()
{		
	global $g_cgival, $g_pro, $g_show, $config;
	
	cgi::both($g_cgival["url"], "url", "");
	$g_cgival['url'] 	= string::un_html($g_cgival['url']);
}


function get_data()
{
	global $g_cgival, $g_pro, $g_show, $config;
	
	$user_info = new user_info();
	$user_detail_info = $user_info->drop_cookie();
	
	if(!$g_cgival['url'])
	{
		$g_cgival['url'] = "/index.php";
	}
	
	$g_show["url"] = $g_cgival['url'] ;
	
	header("Location:{$g_show["url"]}");
	
}
try {
	
	check_cgi_pro();
	get_data();
	$g_show["error"] = 0;
	$g_show["errmsg"] = "";
	
	
} 
catch (Exception $e) 
{
	$g_show["error"] = 1;
	$g_show["errmsg"] = $e->getMessage();
	
}
show_pro();

exit;

function show_pro()
{
	global $g_cgival, $g_pro, $g_show, $config;

	print_r($g_show);
print_r($_COOKIE);
	unset($g_cgival);
	unset($g_pro);
	unset($g_show);
	unset($config);
}

